package com.zhiyou100.service.imp;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.zhiyou100.IService.ILetterService;
import com.zhiyou100.mapper.ViewLetMapper;
import com.zhiyou100.pojo.ViewLet;
import com.zhiyou100.pojo.ViewLetExample;
import com.zhiyou100.pojo.ViewLetExample.Criteria;

@Service("letterService")
public class LetterService implements ILetterService{

	
	//注入mapper对象
	@Resource
	private ViewLetMapper viewLetMapper;
	
	public List<ViewLet> queryAll() {
	ViewLetExample viewLetExample = new ViewLetExample();
	  Criteria createCriteria = viewLetExample.createCriteria();
	createCriteria.andLecontentNotEqualTo("中国石油");
	return viewLetMapper.selectByExample(viewLetExample);
}
	public Integer deleteLetter(Integer le_id) {
	ViewLet viewLet = new ViewLet();
	viewLet.setLestatus("2");	
	ViewLetExample viewLetExample = new ViewLetExample();
	Criteria criteria = viewLetExample.createCriteria();
	criteria.andLestatusEqualTo("le_id");
	return viewLetMapper.updateByExampleSelective(viewLet,viewLetExample);
}

}
